using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._UtilityNetworkTools._Administration
{
    /// <summary>
    /// <para>Add Network Attribute</para>
    /// <para>Adds a network attribute to a utility network.</para>
    /// <para>将网络属性添加到公共设施网络。</para>
    /// </summary>    
    [DisplayName("Add Network Attribute")]
    public class AddNetworkAttribute : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddNetworkAttribute()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_utility_network">
        /// <para>Input Utility Network</para>
        /// <para>The input utility network where the network attribute will be added.</para>
        /// <para>将在其中添加网络属性的输入公共设施网络。</para>
        /// </param>
        /// <param name="_attribute_name">
        /// <para>Attribute Name</para>
        /// <para>The name of the network attribute to add to the utility network.</para>
        /// <para>要添加到公共设施网络的网络属性的名称。</para>
        /// </param>
        /// <param name="_attribute_type">
        /// <para>Attribute Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the data type of the network attribute.</para>
        ///   <bulletList>
        ///     <bullet_item>Short (small integer)—Short integer type</bullet_item><para/>
        ///     <bullet_item>Long (large integer)—Long integer type</bullet_item><para/>
        ///     <bullet_item>Double (double precision)—Double precision type</bullet_item><para/>
        ///     <bullet_item>Date—Date type</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定网络属性的数据类型。</para>
        ///   <bulletList>
        ///     <bullet_item>短（小整数）- 短整数类型</bullet_item><para/>
        ///     <bullet_item>长整型（大整型）- 长整型</bullet_item><para/>
        ///     <bullet_item>双精度（双精度）—双精度型</bullet_item><para/>
        ///     <bullet_item>日期 （Date） - 日期类型</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public AddNetworkAttribute(object _in_utility_network, object _attribute_name, _attribute_type_value? _attribute_type)
        {
            this._in_utility_network = _in_utility_network;
            this._attribute_name = _attribute_name;
            this._attribute_type = _attribute_type;
        }
        public override string ToolboxName => "Utility Network Tools";

        public override string ToolName => "Add Network Attribute";

        public override string CallName => "un.AddNetworkAttribute";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_utility_network, _attribute_name, _attribute_type.GetGPValue(), _is_inline.GetGPValue(), _is_apportionable.GetGPValue(), _domain, _is_overridable.GetGPValue(), _is_nullable.GetGPValue(), _is_substitution.GetGPValue(), _network_attribute_to_substitute, _out_utility_network];

        /// <summary>
        /// <para>Input Utility Network</para>
        /// <para>The input utility network where the network attribute will be added.</para>
        /// <para>将在其中添加网络属性的输入公共设施网络。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Utility Network")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_utility_network { get; set; }


        /// <summary>
        /// <para>Attribute Name</para>
        /// <para>The name of the network attribute to add to the utility network.</para>
        /// <para>要添加到公共设施网络的网络属性的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Attribute Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _attribute_name { get; set; }


        /// <summary>
        /// <para>Attribute Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the data type of the network attribute.</para>
        ///   <bulletList>
        ///     <bullet_item>Short (small integer)—Short integer type</bullet_item><para/>
        ///     <bullet_item>Long (large integer)—Long integer type</bullet_item><para/>
        ///     <bullet_item>Double (double precision)—Double precision type</bullet_item><para/>
        ///     <bullet_item>Date—Date type</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定网络属性的数据类型。</para>
        ///   <bulletList>
        ///     <bullet_item>短（小整数）- 短整数类型</bullet_item><para/>
        ///     <bullet_item>长整型（大整型）- 长整型</bullet_item><para/>
        ///     <bullet_item>双精度（双精度）—双精度型</bullet_item><para/>
        ///     <bullet_item>日期 （Date） - 日期类型</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Attribute Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _attribute_type_value? _attribute_type { get; set; }

        public enum _attribute_type_value
        {
            /// <summary>
            /// <para>Short (small integer)</para>
            /// <para>Short (small integer)—Short integer type</para>
            /// <para>短（小整数）- 短整数类型</para>
            /// </summary>
            [Description("Short (small integer)")]
            [GPEnumValue("SHORT")]
            _SHORT,

            /// <summary>
            /// <para>Long (large integer)</para>
            /// <para>Long (large integer)—Long integer type</para>
            /// <para>长整型（大整型）- 长整型</para>
            /// </summary>
            [Description("Long (large integer)")]
            [GPEnumValue("LONG")]
            _LONG,

            /// <summary>
            /// <para>Double (double precision)</para>
            /// <para>Double (double precision)—Double precision type</para>
            /// <para>双精度（双精度）—双精度型</para>
            /// </summary>
            [Description("Double (double precision)")]
            [GPEnumValue("DOUBLE")]
            _DOUBLE,

            /// <summary>
            /// <para>Date</para>
            /// <para>Date—Date type</para>
            /// <para>日期 （Date） - 日期类型</para>
            /// </summary>
            [Description("Date")]
            [GPEnumValue("DATE")]
            _DATE,

        }

        /// <summary>
        /// <para>In Line</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the network attribute will be persisted in line. In-line network attributes are slightly more efficient, but the number of bits for in-line attributes is limited to 28 per utility network. The most frequently used network attributes (for example, phase for electric networks, pressure for gas and water networks) should be stored in line if possible. The size of the bits is determined by the domain parameter. In-line attributes are only supported for integer network attributes.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The attribute will be added internally to the topology, making retrieval more efficient.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The attribute will be stored in an external table, and retrieval will require a call to the external weights table. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将网络属性保留在行中。内联网络属性的效率略高，但每个公共设施网络内联属性的位数限制为 28 位。如果可能，最常用的管网属性（例如，电网的相位、燃气和水管网的压力）应在线存储。位的大小由域参数确定。只有整数网络属性支持内联属性。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 属性将在拓扑内部添加，从而提高检索效率。</bullet_item><para/>
        ///     <bullet_item>未选中 - 属性将存储在外部表中，检索将需要调用外部权重表。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("In Line")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_inline_value _is_inline { get; set; } = _is_inline_value._false;

        public enum _is_inline_value
        {
            /// <summary>
            /// <para>INLINE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INLINE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_INLINE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_INLINE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Apportionable</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the network attribute will be apportioned across multiple edges belonging to the same feature.</para>
        ///   <para>Network attributes with the apportionable property can be assigned to fields in line or junction feature classes, but only line features will have apportioned behavior.</para>
        ///   <para>For example, with the shape_length network attribute, if one line feature consists of five edge elements, and if the total length of that line feature is 100 feet, that attribute will be apportioned across all edges, with 20 feet for each. The distribution of the value depends on the percentage along each edge element with respect to the from point of the original feature.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The network attribute will be apportioned.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The network attribute will not be apportioned. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将网络属性分配到属于同一要素的多个边。</para>
        ///   <para>可以将具有可分配属性的网络属性分配给线或交汇点要素类中的字段，但只有线要素才具有分摊行为。</para>
        ///   <para>例如，对于shape_length网络属性，如果一个线要素由五个边元素组成，并且该线要素的总长度为 100 英尺，则该属性将分布在所有边上，每个边的长度为 20 英尺。该值的分布取决于沿每个边元素相对于原始要素起始点的百分比。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将分配网络属性。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将不分配网络属性。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Apportionable")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_apportionable_value _is_apportionable { get; set; } = _is_apportionable_value._false;

        public enum _is_apportionable_value
        {
            /// <summary>
            /// <para>APPORTIONABLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("APPORTIONABLE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_APPORTIONABLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_APPORTIONABLE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Domain Name</para>
        /// <para>The domain with which the network attribute is to be associated. This parameter is required when In Line is checked. This domain is used to determine how many bits to allocate for the in-line attribute and must be a coded value type. For example, the LifeCycleStatusDomain (0, Unknown | 1, In-Service | 2, Proposed | 3, Abandoned) domain has four entries, which means 2 bits are required to store the in-line attribute. The coded value domain must have sequential codes starting from 0.</para>
        /// <para>要与网络属性关联的域。选中 In Line 时，此参数是必需的。此域用于确定要为内联属性分配的位数，并且必须是编码值类型。例如，LifeCycleStatusDomain（0，未知 | 1，服务中 | 2，建议 | 3，已放弃）域有四个条目，这意味着需要 2 位来存储内联属性。编码值域必须具有从 0 开始的顺序代码。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Domain Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _domain { get; set; } = null;


        /// <summary>
        /// <para>Is Overridable</para>
        /// <para><xdoc>
        ///   <para>This parameter is not used, and any entered value will be ignored in the current release. The functionality of this parameter is under development and will be applicable in a future release.</para>
        ///   <para>Specifies whether a network attribute has an external override table that the network topology will read and override (or overwrite) the current value stored in the topology. This can be used to input live data from external systems, such as present position in the case of electric or pressure value in the case of gas. An example is a SCADA system pushing the updated switching positions of Device A to the override table of the DeviceStatus network attribute, which the topology engine then uses to override its current value of device status for Device A with the override value.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The current value stored in the topology will be overridden.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The current value stored in the topology will not be overridden. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>不使用此参数，并且在当前版本中将忽略任何输入的值。此参数的功能正在开发中，并将在将来的版本中适用。</para>
        ///   <para>指定网络属性是否具有网络拓扑将读取和覆盖（或覆盖）拓扑中存储的当前值的外部替代表。这可用于输入来自外部系统的实时数据，例如电的当前位置或气体的压值。例如，SCADA系统将设备A的更新开关位置推送到DeviceStatus网络属性的覆盖表，然后拓扑引擎使用该覆盖值覆盖设备A的设备状态的当前值。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 存储在拓扑中的当前值将被覆盖。</bullet_item><para/>
        ///     <bullet_item>未选中 - 存储在拓扑中的当前值不会被覆盖。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Is Overridable")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_overridable_value _is_overridable { get; set; } = _is_overridable_value._false;

        public enum _is_overridable_value
        {
            /// <summary>
            /// <para>OVERRIDE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("OVERRIDE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_OVERRIDABLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_OVERRIDABLE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Nullable</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the network attribute will support null values.
        ///   <bulletList>
        ///     <bullet_item>Checked—The network attribute will support null values.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The network attribute will not support null values. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定网络属性是否支持 null 值。
        ///   <bulletList>
        ///     <bullet_item>选中 - 网络属性将支持空值。</bullet_item><para/>
        ///     <bullet_item>未选中 - 网络属性将不支持空值。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Nullable")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_nullable_value _is_nullable { get; set; } = _is_nullable_value._false;

        public enum _is_nullable_value
        {
            /// <summary>
            /// <para>NULLABLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NULLABLE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_NULLABLE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_NULLABLE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Substitution</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the network attribute will be used as a substitution. Substitution network attributes allow a substituted value to be used instead of bitset network attribute values during a propagation in a trace operation.
        ///   <bulletList>
        ///     <bullet_item>Checked—The network attribute will be used as a substitution.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The network attribute will not be used as a substitution. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否将网络属性用作替换。替换网络属性允许在跟踪操作的传播过程中使用替换值而不是位集网络属性值。
        ///   <bulletList>
        ///     <bullet_item>选中—网络属性将用作替换项。</bullet_item><para/>
        ///     <bullet_item>未选中 - 网络属性不会用作替换。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Substitution")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_substitution_value _is_substitution { get; set; } = _is_substitution_value._false;

        public enum _is_substitution_value
        {
            /// <summary>
            /// <para>SUBSTITUTION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SUBSTITUTION")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_SUBSTITUTION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_SUBSTITUTION")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Network Attribute to Substitute</para>
        /// <para>The network attribute to be used for substitution. Substitutions are encoded based on the number of bits in the network attribute being propagated. The network attribute must be in-line and an integer field type less than or equal to 8 bits.</para>
        /// <para>用于替换的网络属性。替换是根据正在传播的网络属性中的位数进行编码的。network 属性必须是内联属性，并且整数字段类型必须小于或等于 8 位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Network Attribute to Substitute")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _network_attribute_to_substitute { get; set; } = null;


        /// <summary>
        /// <para>Updated Utility Network</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Utility Network")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_utility_network { get; set; }


        public AddNetworkAttribute SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}